package homework01;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;


public class Dome1 {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("note.txt");
        while (true){
            System.out.print("请输入内容:");
            String note = scan.next();
            if(note.equals("exit")){
                System.out.println("感谢使用");
                break;
            }else {
                fos.write(note.getBytes(StandardCharsets.UTF_8));
                System.out.println("添加成功");
            }
        }
    }
}
